package com.green.business.controller;

import com.green.business.domain.Goods;
import com.green.business.domain.Inport;
import com.green.business.domain.Sales;

import com.green.business.service.ReportsService;

import com.green.business.vo.ReportsVo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("reports")
public class ReportsController {
    @Autowired
    private ReportsService reportsService;

    /*
    *进货金额
    *查询进货商品的数量以及商品进货价
    */
    @RequestMapping("queryInports")
    public Double queryInports(ReportsVo reportsVo)
    {

        return this.reportsService.queryInports(reportsVo);
    }


    /*
    * 销售金额
    * 查询销售商品的数量以及销售商品的价格
    * */
    @RequestMapping("querySales")
    public Double querySales(ReportsVo reportsVo)
    {
        return this.reportsService.querySales(reportsVo);
    }
    /*
    * 总商品数量
    * */
    @RequestMapping("queryGoodsnum")
    public Integer queryGoodsnum(ReportsVo reportsVo){
        return this.reportsService.queryGoodsnum(reportsVo);
    }

    /*
    * 畅销商品
    * */
    @RequestMapping("querySalableGoods")
    public List<Map.Entry<String, Integer>> querySalableGoods(ReportsVo reportsVo)
    {

        return this.reportsService.querySalableGoods(reportsVo);
    }
    /*
    * 超市金额
    * */
    @RequestMapping("queryMarketsum")
    public Double queryMarketsum(ReportsVo reportsVo){
        return this.reportsService.queryMarketsum(reportsVo);
    }
    /*
    * 畅销商品类型
    * */
    @RequestMapping("querySalableGoodsType")
    public List<Map.Entry<String, Integer>> querySalableGoodsType(ReportsVo reportsVo){
        return this.reportsService.querySalableGoodsType(reportsVo);
    }
}
